import { HTTP } from "@/utils/helper";

// 获取历史记录列表
export function getSysJobLogs(obj) {
  return HTTP({
    url: "/sysJobLog/getSysJobLogs",
    data: obj,
  });
}

//新增任务
export function addjob(obj) {
  return HTTP({
    url: "/AutomaticCode/addjob",
    data: obj,
    method: "post",
  });
}

// 批量新增任务
export function batchAddjob(obj) {
  return HTTP({
    url: "/AutomaticCode/batchAddjob",
    data: obj,
    method: "post",
  });
}


//单次执行任务
export function carryOutOne(obj) {
  return HTTP({
    url: "/AutomaticCode/carryOutOne",
    data: obj,
    method: "post",
  });
}

// 删除任务
export function deletejob(obj) {
  return HTTP({
    url: "/AutomaticCode/deletejob",
    data: obj,
    method: "post",
  });
}

//获取实体类型
export function getEntityTypes(obj) {
  return HTTP({
    url: "/AutomaticCode/getEntityTypes",
    data: obj,
    method: "get",
  });
}

// 获取任务列表
export function getJobs(obj) {
  return HTTP({
    url: "/AutomaticCode/getJobs",
    data: obj,
  });
}

// 获取任务进度
export function getSchedule(obj) {
  return HTTP({
    url: "/AutomaticCode/getSchedule",
    data: obj,
    method: "get",
  });
}

// 暂停任务
export function pausejob(obj) {
  return HTTP({
    url: "/AutomaticCode/pausejob",
    data: obj,
    method: "post",
  });
}

// 重启任务
export function reschedulejob(obj) {
  return HTTP({
    url: "/AutomaticCode/reschedulejob",
    data: obj,
    method: "post",
  });
}

// 恢复任务
export function resumejob(obj) {
  return HTTP({
    url: "/AutomaticCode/resumejob",
    data: obj,
    method: "post",
  });
}

// 获取实体字段
export function getEntityTypeFields(obj) {
  return HTTP({
    url: "/entityTypeField/getEntityTypeFields",
    data: obj,
    method: "post",
  });
}
